<template>
	<view class="uni_box home">
		<navbar title='充币' :yin="false">
			<view class="hright" slot="right" @click="getrightClick">
				<image class="chongji" src="/static/img/chongji.png" mode="" />
			</view>
		</navbar>
		<view class="content">
			<view class="Recharge-one">
				<image class="usdt" :src="rechangeinfo.logo" mode="" />
				<text class="Recharge-name">{{rechangeinfo.name}}地址</text>
			</view>
			
			<view class="Recharge-modal">
				<view class="Recharge-top">
					<text class="Recharge-name">充币网络</text>
				</view>
				<view class="Recharge-input" @click="xuanwang">
					<text class="Recharge-select" :class="rechange.label?'xactive':''">{{rechange.label?rechange.label:'请选择'}}</text>
					<image class="xia" src="/static/img/xia.png" mode="" />
				</view>
			</view>
			
			<view class="Recharge-adress">
				<text class="Recharge-adress-tit">充币地址</text>
				<view class="chongview">
					<view class="maview" >
						<uv-qrcode ref="qrcode" size="120px" v-if="rechange.address" :value="rechange.address"></uv-qrcode>
						<!-- <image class="bicon" src="/static/img/bicon.png" mode="" /> -->
					</view>
					<view class="mtwo">
						<view class="mleft">
							<view class="diview">
								<text class="ldi">充币地址</text>
								
								<image class="copy" src="/static/img/copy.png" mode="" @click="copy(rechange.address)" />
							</view>
							<text class="ldival txt">{{rechange.address}}</text>
						</view>
					</view>
				</view>
			</view>
			<view class="Recharge-price">
				<view class="Recharge-price-item">
					<text class="Recharge-price-left">最小充币额</text>
					<text class="Recharge-price-right">{{sinfo.site.min_recharge}}USDT</text>
				</view>
				<!-- <view class="Recharge-price-item">
					<text class="Recharge-price-left">最大充币额</text>
					<text class="Recharge-price-right">{{sinfo.site.max_recharge}}USDT</text>
				</view> -->
				<view class="Recharge-price-item">
					<text class="Recharge-price-left">充币到账</text>
					<text class="Recharge-price-right">1次网络确认</text>
				</view>
				<view class="Recharge-price-item">
					<text class="Recharge-price-left">提币解锁</text>
					<text class="Recharge-price-right">1次网络确认</text>
				</view>
			</view>
		</view>

		<u-select v-model="bshow" :list="uslist" @confirm="bconfirm"></u-select>
	</view>
</template>

<script>

	export default {
		data() {
			return {
				value:'',
				wang:'',
				bshow:false,
				blist:[
					{
						value: '1',
						label: '江'
					},
					{
						value: '2',
						label: '湖'
					}
				],
				rechangeinfo:{
					logo:'/static/img/usdticon.png',
					name:'TRC20'
				},
				rechangelist:[],
				info:{},
				uslist:[],
				rechange:{
					address:'',
					label:'TRC20'
				},
				sinfo:{
					site:{
						min_recharge:''
					}
				},

			}
		},
		onLoad() {
			this.getrechange();
			this.getinviteinfo()
			this.getstatistic()
		},
		onShow() {
		},
		methods: {
			async getrechange(){
				let res = await this.$u.api.rechange_address({
					
				});
				
				this.rechangelist = res
				this.rechangeinfo = res[0]
				let arry = []
				let items = this.rechangeinfo.item
				for(let i in items){
					items[i].label = items[i].title
					items[i].value = items[i].title
				}
				this.uslist = items
				this.rechange = this.uslist[0]
			},
			async getinviteinfo(){
				let res = await this.$u.api.userinfo({
				});
				this.info = res
				// if(this.type == 'home'&&!this.yaoshow){
				// 	this.yaoshow = true
				// }
			},
			async getstatistic(){
				let res = await this.$u.api.apiconfig({
					// type:'day'
				});
				// console.log(res)
				this.sinfo = res
			},
			xuanwang(){
				this.bshow = true
			},
			bconfirm(e){
				console.log(e)
				this.wang = e[0].value
				let uslist = this.uslist
				for(let i in uslist){
					if(uslist[i].label == e[0].label){
						this.rechange = uslist[i]
					}
				}
			},
			getrightClick(){
				this.navrouter("/pages/TPage/BiRecord?type=1");
			}

		}
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #fff;
	}
	.chongji{
		width: 38rpx;
		height: 36rpx;
	}
	.content{
		background-color: #fff;
		padding: 30rpx 40rpx;
		.Recharge-one{
			display: flex;
			flex-direction: row;
			align-items: center;
			margin-bottom: 59rpx;
			.usdt{
				width: 46rpx;
				height: 46rpx;
				margin-right: 12rpx;
			}
			.Recharge-name{
				font-family: Source Han Sans CN;
				font-weight: bold;
				font-size: 36rpx;
				color: #000000;
			}
		}
		.Recharge-adress{
			.Recharge-adress-tit{
				display: flex;
				font-family: Source Han Sans CN;
				font-weight: 400;
				font-size: 30rpx;
				color: #000000;
				display: block;
				margin-bottom: 19rpx;
			}
			.chongview{
				padding: 50rpx;
				background: #F7F7F7;
				border-radius: 20rpx;
				display: flex;
				flex-direction: column;
				align-items: center;
				.maview{
					width: 130px;
					height: 130px;
					border: 10rpx solid #fff;
					.bicon{
						width: 100%;
						height: 100%;
					}
				}
				.mtwo{
					display: flex;
					flex-direction: row;
					align-items: center;
					margin-top: 50rpx;
					width: 100%;
					.mleft{
						display: flex;
						flex-direction: column;
						width: 100%;
						margin: 0 auto;
						.diview{
							display: flex;
							flex-direction: row;
							align-items: center;
							width: 100%;

						}
						.copy{
							margin-left: auto;
							width: 30rpx;
							height: 30rpx;
						}
						.ldi{
							font-family: Source Han Sans CN;
							font-weight: 400;
							font-size: 24rpx;
							color: #8B8B8B;
						}
						.ldival{
							font-family: Source Han Sans CN;
							font-weight: 400;
							font-size: 28rpx;
							color: #000000;
							display: block;
							margin-top: 20rpx;
							width: 100%;
						}
					}
				}
			}
		}
		.Recharge-modal{
			display: flex;
			flex-direction: column;
			margin-bottom: 55rpx;
			.Recharge-top{
				display: flex;
				flex-direction: row;
				align-items: center;

			}
			.usdt{
				width: 46rpx;
				height: 46rpx;
				margin-right: 12rpx;
			}
			.Recharge-name{
				font-family: Source Han Sans CN;
				font-weight: 400;
				font-size: 30rpx;
				color: #000000;
			}
		}
		.Recharge-input{
			padding: 12rpx 25rpx;
			background: #F7F7F7;
			border-radius: 20rpx;
			margin-top: 24rpx;
			display: flex;
			align-items: center;
			flex-direction: row;
			min-height: 47px;
			/deep/.u-input__input{
				font-weight: 400;
				font-size: 28rpx;
				color: #000000;
			}
			.Recharge-select{
				color: #c0c4cc;
			}
			.xactive{
				font-weight: 400;
				font-size: 28rpx;
				color: #000000;
			}
			.xia{
				margin-left: auto;
				width: 16rpx;
				height: 10rpx;
			}
			.quanbu{
				margin-left: 30rpx;
				display: flex;
				flex-direction: row;
				align-items: center;
				font-family: Source Han Sans CN;
				font-weight: 400;
				font-size: 28rpx;
				color: #010101;
			}
			.huoqu{
				padding: 8rpx 28rpx;
				margin-left: 30rpx;
				background: #000000;
				border-radius: 50rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				font-size: 28rpx;
				color: #FFFFFF;
			}
		}
		.keyong{
			display: block;
			text-align: right;
			font-family: Source Han Sans CN;
			font-weight: 400;
			font-size: 22rpx;
			color: #010101;
			margin-bottom: 75rpx;
		}
		
		.sbotview{
			margin: 100rpx 0;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			.shoufei{
				font-family: Source Han Sans CN;
				font-weight: 400;
				font-size: 22rpx;
				color: #010101;
				display: block;
				margin-bottom: 15rpx;


			}
			.btn{
				width: 100%;
				height: 80rpx;
				background: #030000;
				border-radius: 40rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				font-family: Source Han Sans CN;
				font-weight: 500;
				font-size: 30rpx;
				color: #FFFFFF;
			}
		}
		.Recharge-price{
			background: #F7F7F7;
			border-radius: 10rpx;
			margin-top: 36rpx;
			padding: 40rpx 30rpx 20rpx;
			.Recharge-price-item{
				margin-bottom: 20rpx;
				display: flex;
				flex-direction: row;
				align-items: center;
				.Recharge-price-left{
					font-family: Source Han Sans CN;
					font-weight: 500;
					font-size: 24rpx;
					color: #8B8B8B;
				}
				.Recharge-price-right{
					margin-left: auto;
					font-family: Source Han Sans CN;
					font-weight: 500;
					font-size: 24rpx;
					color: #000000;
				}
			}
		}
		// padding-bottom: 150rpx;
	}
</style>
